ArcPad Scripting Object Model Reference > ArcPad Scripting Samples > File Object Example |
VBScript |
Copy Code |
---|---|
'Initialise a File Object Dim objFile Set objFile = Application.CreateAppObject("file") 'Set a Directory path for the file Dim objDir objDir = System.Properties("PersonalFolder") 'Set a file name Dim objFileName objFileName = "LogFile_" & Application.User & ".txt" 'Create (or open) a file Call objFile.Open (objDir & "\" & objFileName, 2) 'Write a line into the file Call objFile.Write ("Hello ArcPad World!") 'Close the file - This also saves the file objFile.Close |
JScript |
Copy Code |
---|---|
//Initialise a File Object var objFile = Application.CreateAppObject("file") //Set a Directory path for the file var objDir = System.Properties("PersonalFolder") //Set a file name var objFileName = "LogFile_" + Application.User + ".txt" //Create (or open) a file objFile.Open (objDir + "\\" + objFileName, 2) //Write a line into the file objFile.Write ("Hello ArcPad World!"); //Close the file - This also saves the file objFile.Close(); |
Python |
Copy Code |
---|---|
#Initialise a File Object objFile = Application.CreateAppObject("file") #Set a Directory path for the file objDir = "C:\\Temp" #Set a file name objFileName = "LogFile_" + str(Application.User) + ".txt" #Create (or open) a file objFile.Open (objDir + "\\" + objFileName, 2) objFile.Write ("Hello ArcPad World!") #Close the file - This also saves the file objFile.Close() |